﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Diagnostics;

namespace IPCameHotKey
{
    public class BlockLeftMouseButtonMessageFilter : IMessageFilter
    {
        //private const int WH_MOUSE = 7;
        //private const int WH_KEYBOARD = 2;
        //private const int WH_MOUSE_LL = 14;
        //private const int WH_KEYBOARD_LL = 13;


        public bool PreFilterMessage(ref Message m)
        {
            //if (m.Msg == 2)
            { Debug.WriteLine(m.ToString()); }
            return false;
        }

    }

    public partial class Form1 : Form
    {
        private KeyboardHook hook = new KeyboardHook();

        public Form1()
        {
            InitializeComponent();

            //Помещаем иконку в трей
            this.ShowInTaskbar = true;

           BlockLeftMouseButtonMessageFilter _ft = new BlockLeftMouseButtonMessageFilter();

           Application.AddMessageFilter(_ft);

           OckShowKeyboardState.Hooks.SetHook();

        }

        void hook_KeyPressed(object sender, KeyPressedEventArgs e)
        {
            
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Visible = false;
        }

        private void nfTray_Click(object sender, EventArgs e)       
        {
            this.Visible = true;
        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.ShowInTaskbar = false;
        }
    }
}
